﻿using System;
using System.Configuration;
using System.ServiceProcess;
using Microsoft.Owin.Hosting;
using Sustainalytics.Websites.Client.Library;

namespace Sustainalytics.Websites.Client.Service
{
    public partial class ClientWebsiteService : ServiceBase
    {
       
        public ClientWebsiteService()
        {
            InitializeComponent();
        }

        protected override void OnStart(string[] args)
        {
            try
            {
                string url = ConfigurationManager.AppSettings["hostUrl"];
                WebApp.Start<Startup>(url);
            }
            catch (Exception ex)
            {
                EventLog.Log = ex.Message;
            }
        }

        protected override void OnStop()
        {
        }
    }
}
